<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%--ctxPath--%>
<c:set var="ctxPath" value="${pageContext.request.contextPath}" />
<c:set var="shiroUser" value="${sessionScope.sUser}" />
<%--静态文件目录 --%>
<c:set var="staticPath" value="${ctxPath}/static" />

<div id="navbar" class="navbar navbar-default">  
    <div class="navbar-container" id="navbar-container">
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only">Toggle sidebar</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>

        <!-- /section:basics/sidebar.mobile.toggle -->
        <div class="navbar-header pull-left">
            <!-- #section:basics/navbar.layout.brand -->
            <a href="#" class="navbar-brand"  style="padding-bottom: 5px;padding-top: 5px;">
               <small>
<%--                  <i><img alt="logo"  style="width: 48px; height: 36px;" src="${ctxPath}/static/assets/images/yhlogo_top.png"></i>&nbsp;&nbsp; --%>
                 <span style="font-family:'微软雅黑';font-weight:bold;font-size:30px;vertical-align:middle;letter-spacing:6px;">XXX公司财务管理系统</span>	
               </small>
            </a>
        </div>


        <!-- #section:basics/navbar.dropdown -->
        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                    <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="${staticPath}/assets/img/user.png" alt="UserImg" />
                        <span class="user-info">    
                        ${shiroUser.role.name}
						${shiroUser.user.userName}
						 </span>
                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-blue dropdown-caret dropdown-close">
                        <li>
                            <a href="javascript:void(0)" onclick="logout()">
                                <i class="ace-icon fa fa-power-off"></i>安全退出
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>

        <!-- /section:basics/navbar.dropdown -->
    </div><!-- /.navbar-container -->
</div>
<script type="text/javascript">
  		var ctxPath = "${ctxPath }";
        function logout(){
        	 layer.confirm('确认退出？', {icon: 2, title:'警告'}, function(index){
                $.ajax({
               		url:'${ctxPath }/logout.do',
               		datatype:'json',
               		type: "post",
               		success:function(data) {	
                	if(data.status='0'){
						 window.location.href='${ctxPath}';
					}
                }
               });
                
                
        	 })
        }
      
    </script>
